
$(function () {

    $("#top").load("top.html");
    $("#left").load("teacher_left.html",function () {
        menuActive(0,0)
    });

    var userId = sessionStorage.getItem('userId');
    requests.getReq(urls.getTeaInfo + '/' + userId, '', succeInfo, errorInfo);

    function succeInfo(data) {
        if (data.status == 1 && data.data) {
            var info = data.data;
            var hiringTime = compTime(info.hiringTime);
            var listName = [
                {title: '教师编号：',cont: info.userId},
                {title: '教师姓名：',cont: info.userName},
                {title: '教师性别：',cont: commonGender[info.sex]},
                {title: '职称：',cont: commonTitle[info.title]},
                {title: '岗位级别：',cont: info.teacherPostLevel},
                {title: '学历：',cont: commonEducation[info.education]},
                {title: '聘用时间：',cont: hiringTime},
                {title: '所属学院：',cont: info.collegeName},
                {title: '所属教研室：',cont: info.researchName},
            ];
            var infoHtml = '';
            $.each(listName,function f(i,val) {
                infoHtml += '<li><label>'+val.title+'</label><span class="item_cont">'+val.cont+'</span></li>'
            })
            $(".forminfo").html(infoHtml);
        } else {
            showTip('未查询到相关信息');
        }
    }

    function errorInfo() {
        showTip('查询失败');
    }

})